#pragma once

#include "Resource.h"
#include "stdafx.h"

class VlcPlayForm : public ui::Control
{
public:
    VlcPlayForm(void) { m_hwnd = NULL; };
    ~VlcPlayForm(void) {};

    virtual void SetInternVisible(bool bVisible = true)
    {
        __super::SetInternVisible(bVisible);
        ::ShowWindow(m_hwnd, bVisible);
    }

    virtual void SetPos(RECT rc)
    {
        __super::SetPos(rc);
        ::SetWindowPos(m_hwnd, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW); //SWP_SHOWWINDOW     //SWP_NOZORDER | SWP_NOACTIVATE
    }

    BOOL Attach(HWND hWndNew)
    {
        if (!::IsWindow(hWndNew))
        {
            return FALSE;
        }

        m_hwnd = hWndNew;
        return TRUE;
    }

    HWND Detach()
    {
        HWND hWnd = m_hwnd;
        m_hwnd = NULL;
        return hWnd;
    }

    HWND Gethwnd() { return m_hwnd; }

protected:
	HWND m_hwnd;
};

